﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using SnongPhoneShop.Models;

namespace SnongPhoneShop.Controllers
{
    public class HomeController : Controller
    {
        //
        // GET: /Home/

        SnongPhoneShopEntities db = new SnongPhoneShopEntities();
        public ActionResult Index()
        {
            return View(db);
        }

        public ActionResult Gioi_Thieu()
        {
            return View();
        }

        public ActionResult ClearRecently()
        {
            if (Request.Cookies["Recently"] != null)
            {
                HttpCookie newCookie = Request.Cookies["Recently"];
                newCookie.Expires = DateTime.Now.AddDays(-1);
                Response.Cookies.Add(newCookie);
            }
            return Redirect(Request.UrlReferrer.OriginalString);
        }
    }
}
